# VC++ 6.0 Makefile for SQLite+SEE 3.5.1

#### The toplevel directory of the source tree.
#

TOP = ..\sqlite-3-see

#### C Compiler and options for use in building executables that
#    will run on the platform that is doing the build.

BCC = cl -Gs -GX -D_WIN32 -nologo -Zi

#### Leave MEMORY_DEBUG undefined for maximum speed.  Use MEMORY_DEBUG=1
#    to check for memory leaks.  Use MEMORY_DEBUG=2 to print a log of all
#    malloc()s and free()s in order to track down memory leaks.
#    
#    SQLite uses some expensive assert() statements in the inner loop.
#    You can make the library go almost twice as fast if you compile
#    with -DNDEBUG=1

#OPTS = -DMEMORY_DEBUG=2
#OPTS = -DMEMORY_DEBUG=1
#OPTS = 
OPTS = -DNDEBUG=1

#### C Compile and options for use in building executables that 
#    will run on the target platform.  This is usually the same
#    as BCC, unless you are cross-compiling.

TCC = cl -Gs -GX -D_WIN32 -nologo -Zi -DOS_WIN=1

# You should not have to change anything below this line
###############################################################################

# This is how we compile

TCCX = $(TCC) $(OPTS) -DWIN32=1 -DTHREADSAFE=1 -DOS_WIN=1 \
	-DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SOUNDEX=1 \
	-DSQLITE_HAS_CODEC=1 \
	-DSQLITE_OMIT_LOAD_EXTENSION=1 -I. -I$(TOP)

TCCXD = $(TCCX) -D_DLL

# Object files for the SQLite library.

LIBOBJ = alter.obj analyze.obj attach.obj auth.obj btmutex.obj btree.obj \
	 build.obj callback.obj complete.obj crypto3.obj \
	 date.obj delete.obj expr.obj func.obj hash.obj insert.obj \
	 journal.obj loadext.obj main.obj malloc.obj mem1.obj mem2.obj \
	 mem3.obj mutex.obj mutex_w32.obj  opcodes.obj os.obj os_win.obj \
	 pager.obj parse.obj pragma.obj prepare.obj printf.obj random.obj \
	 select.obj table.obj tokenize.obj trigger.obj update.obj \
	 util.obj vacuum.obj vdbe.obj vdbeapi.obj vdbeaux.obj vdbeblob.obj \
	 vdbefifo.obj vdbemem.obj \
	 where.obj utf.obj legacy.obj vtab.obj

# All of the source code files.

SRC = \
  $(TOP)/alter.c \
  $(TOP)/analyze.c \
  $(TOP)/attach.c \
  $(TOP)/auth.c \
  $(TOP)/btmutex.c \
  $(TOP)/btree.c \
  $(TOP)/btree.h \
  $(TOP)/btreeInt.h \
  $(TOP)/build.c \
  $(TOP)/callback.c \
  $(TOP)/complete.c \
  $(TOP)/crypto3.c \
  $(TOP)/date.c \
  $(TOP)/delete.c \
  $(TOP)/expr.c \
  $(TOP)/func.c \
  $(TOP)/hash.c \
  $(TOP)/hash.h \
  $(TOP)/insert.c \
  $(TOP)/journal.c \
  $(TOP)/legacy.c \
  $(TOP)/loadext.c \
  $(TOP)/main.c \
  $(TOP)/malloc.c \
  $(TOP)/mem1.c \
  $(TOP)/mem2.c \
  $(TOP)/mem3.c \
  $(TOP)/mutex.c \
  $(TOP)/mutex.h \
  $(TOP)/mutex_w32.c \
  $(TOP)/os.c \
  $(TOP)/os.h \
  $(TOP)/os_win.c \
  $(TOP)/pager.c \
  $(TOP)/pager.h \
  $(TOP)/parse.c \
  $(TOP)/pragma.c \
  $(TOP)/prepare.c \
  $(TOP)/printf.c \
  $(TOP)/random.c \
  $(TOP)/select.c \
  $(TOP)/shell.c \
  $(TOP)/sqlite.h.in \
  $(TOP)/sqlite3ext.h \
  $(TOP)/sqliteInt.h \
  $(TOP)/sqliteLimit.h \
  $(TOP)/table.c \
  $(TOP)/tokenize.c \
  $(TOP)/trigger.c \
  $(TOP)/utf.c \
  $(TOP)/update.c \
  $(TOP)/util.c \
  $(TOP)/vacuum.c \
  $(TOP)/vdbe.c \
  $(TOP)/vdbe.h \
  $(TOP)/vdbeapi.c \
  $(TOP)/vdbeaux.c \
  $(TOP)/vdbeblob.c \
  $(TOP)/vdbefifo.c \
  $(TOP)/vdbemem.c \
  $(TOP)/vdbeInt.h \
  $(TOP)/vtab.c \
  $(TOP)/where.c

# Header files used by all library source files.

HDR = \
   $(TOP)/sqlite3.h  \
   $(TOP)/btree.h \
   $(TOP)/btreeInt.h \
   $(TOP)/hash.h \
   $(TOP)/sqliteLimit.h \
   $(TOP)/opcodes.h \
   $(TOP)/os.h \
   $(TOP)/os_common.h \
   $(TOP)/sqlite3ext.h  \
   $(TOP)/sqliteInt.h  \
   $(TOP)/vdbe.h  \
   $(TOP)/parse.h

# Header files used by the VDBE submodule

VDBEHDR = \
   $(HDR) \
   $(TOP)/vdbeInt.h

# This is the default Makefile target.  The objects listed here
# are what get build when you type just "make" with no arguments.

all:	libsqlite3see.lib

libsqlite3see.lib:	$(LIBOBJ)
	lib -out:$@ $(LIBOBJ)

alter.obj:	$(TOP)/alter.c $(HDR)
	$(TCCXD) -c $(TOP)/alter.c

analyze.obj:	$(TOP)/analyze.c $(HDR)
	$(TCCXD) -c $(TOP)/analyze.c

attach.obj:	$(TOP)/attach.c $(HDR)
	$(TCCXD) -c $(TOP)/attach.c

auth.obj:	$(TOP)/auth.c $(HDR)
	$(TCCXD) -c $(TOP)/auth.c

btmutex.obj:	$(TOP)/btmutex.c $(HDR)
	$(TCCXD) -c $(TOP)/btmutex.c

btree.obj:	$(TOP)/btree.c $(HDR) $(TOP)/pager.h
	$(TCCXD) -c $(TOP)/btree.c

build.obj:	$(TOP)/build.c $(HDR)
	$(TCCXD) -c $(TOP)/build.c

callback.obj:	$(TOP)/callback.c $(HDR)
	$(TCCXD) -c $(TOP)/callback.c

complete.obj:	$(TOP)/complete.c $(HDR)
	$(TCCXD) -c $(TOP)/complete.c

crypto3.obj:	$(TOP)/crypto3.c $(HDR)
	$(TCCXD) -c $(TOP)/crypto3.c

date.obj:	$(TOP)/date.c $(HDR)
	$(TCCXD) -c $(TOP)/date.c

delete.obj:	$(TOP)/delete.c $(HDR)
	$(TCCXD) -c $(TOP)/delete.c

expr.obj:	$(TOP)/expr.c $(HDR)
	$(TCCXD) -c $(TOP)/expr.c

func.obj:	$(TOP)/func.c $(HDR)
	$(TCCXD) -c $(TOP)/func.c

hash.obj:	$(TOP)/hash.c $(HDR)
	$(TCCXD) -c $(TOP)/hash.c

insert.obj:	$(TOP)/insert.c $(HDR)
	$(TCCXD) -c $(TOP)/insert.c

journal.obj:	$(TOP)/journal.c $(HDR)
	$(TCCXD) -c $(TOP)/journal.c

legacy.obj:	$(TOP)/legacy.c $(HDR)
	$(TCCXD) -c $(TOP)/legacy.c

loadext.obj:	$(TOP)/loadext.c $(HDR)
	$(TCCXD) -c $(TOP)/loadext.c

main.obj:	$(TOP)/main.c $(HDR)
	$(TCCXD) -c $(TOP)/main.c

mem1.obj:	$(TOP)/mem1.c $(HDR)
	$(TCCXD) -c $(TOP)/mem1.c

mem2.obj:	$(TOP)/mem2.c $(HDR)
	$(TCCXD) -c $(TOP)/mem2.c

mem3.obj:	$(TOP)/mem3.c $(HDR)
	$(TCCXD) -c $(TOP)/mem3.c

malloc.obj:	$(TOP)/malloc.c $(HDR)
	$(TCCXD) -c $(TOP)/malloc.c

mutex.obj:	$(TOP)/mutex.c $(HDR)
	$(TCCXD) -c $(TOP)/mutex.c

mutex_w32.obj:	$(TOP)/mutex_w32.c $(HDR)
	$(TCCXD) -c -DTryEnterCriticalSection=!sizeof $(TOP)/mutex_w32.c

pager.obj:	$(TOP)/pager.c $(HDR) $(TOP)/pager.h
	$(TCCXD) -c $(TOP)/pager.c

opcodes.obj:	opcodes.c $(HDR)
	$(TCCXD) -c opcodes.c

os.obj:	$(TOP)/os.c $(HDR)
	$(TCCXD) -c $(TOP)/os.c

os_win.obj:	$(TOP)/os_win.c $(HDR)
	$(TCCXD) -c $(TOP)/os_win.c

parse.obj:	parse.c $(HDR)
	$(TCCXD) -c parse.c

pragma.obj:	$(TOP)/pragma.c $(HDR)
	$(TCCXD) -c $(TOP)/pragma.c

prepare.obj:	$(TOP)/prepare.c $(HDR)
	$(TCCXD) -c $(TOP)/prepare.c

printf.obj:	$(TOP)/printf.c $(HDR)
	$(TCCXD) -c $(TOP)/printf.c

random.obj:	$(TOP)/random.c $(HDR)
	$(TCCXD) -c $(TOP)/random.c

select.obj:	$(TOP)/select.c $(HDR)
	$(TCCXD) -c $(TOP)/select.c

table.obj:	$(TOP)/table.c $(HDR)
	$(TCCXD) -c $(TOP)/table.c

tokenize.obj:	$(TOP)/tokenize.c keywordhash.h $(HDR)
	$(TCCXD) -c $(TOP)/tokenize.c

trigger.obj:	$(TOP)/trigger.c $(HDR)
	$(TCCXD) -c $(TOP)/trigger.c

update.obj:	$(TOP)/update.c $(HDR)
	$(TCCXD) -c $(TOP)/update.c

utf.obj:	$(TOP)/utf.c $(HDR)
	$(TCCXD) -c $(TOP)/utf.c

util.obj:	$(TOP)/util.c $(HDR)
	$(TCCXD) -c $(TOP)/util.c

vacuum.obj:	$(TOP)/vacuum.c $(HDR)
	$(TCCXD) -c $(TOP)/vacuum.c

vdbe.obj:	$(TOP)/vdbe.c $(VDBEHDR)
	$(TCCXD) -c $(TOP)/vdbe.c

vdbeapi.obj:	$(TOP)/vdbeapi.c $(VDBEHDR)
	$(TCCXD) -c $(TOP)/vdbeapi.c

vdbeaux.obj:	$(TOP)/vdbeaux.c $(VDBEHDR)
	$(TCCXD) -c $(TOP)/vdbeaux.c

vdbeblob.obj:	$(TOP)/vdbeblob.c $(VDBEHDR)
	$(TCCXD) -c $(TOP)/vdbeblob.c

vdbefifo.obj:	$(TOP)/vdbefifo.c $(VDBEHDR)
	$(TCCXD) -c $(TOP)/vdbefifo.c

vdbemem.obj:	$(TOP)/vdbemem.c $(VDBEHDR)
	$(TCCXD) -c $(TOP)/vdbemem.c

vtab.obj:	$(TOP)/vtab.c $(HDR)
	$(TCCXD) -c $(TOP)/vtab.c

where.obj:	$(TOP)/where.c $(HDR)
	$(TCCXD) -c $(TOP)/where.c

clean:
	del *.obj
	del *.pdb
	del *.lib

